package com.ky.gp.app.controller;

import com.ky.common.param.NewsAdd;
import com.ky.common.param.NewsReviewAdd;
import com.ky.common.vo.R;
import com.ky.gp.app.service.SearchHomeCourseFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ky.common.param.QuestionAdd;

/**
 * @version 1.0
 * @Author 小胤
 * @Date 2024/6/16 18:40
 * @注释
 */
@RestController
@RequestMapping("/api/home")
public class SearchHomeController {
    @Autowired
    private SearchHomeCourseFeign searchhomeCourseFeign;
    @RequestMapping("/getCourse")
    public R getCourse(){
        return searchhomeCourseFeign.getCourse();
    }

    @RequestMapping("/getArticle")
    public R getArticle(){
        return searchhomeCourseFeign.getArticle();
    }

    @RequestMapping("/getExp")
    public R getExp(){
        return searchhomeCourseFeign.getExp();
    }
    @RequestMapping("/getNews")
    public R getNews(){
        return searchhomeCourseFeign.getNews();
    }
    @RequestMapping("/search/all")
    public R searchAll(){
        return searchhomeCourseFeign.searchAll();
    }
    @RequestMapping("/search/{value}")
    public R search(@PathVariable("value")String value){
        return searchhomeCourseFeign.search(value);
    }
    @RequestMapping("/searchNews/{value}")
    public R searchNews(@PathVariable("value")String value){
        return searchhomeCourseFeign.searchNews(value);
    }
    @RequestMapping("/getNewsDetails/{id}")
    public R getNewsById(@PathVariable("id")int id){
        return searchhomeCourseFeign.getNewsById(id);
    }
    @RequestMapping("/createNews")
    public R createNews(@RequestBody NewsAdd newsAdd){
        return searchhomeCourseFeign.createNews(newsAdd);
    }
    @RequestMapping("/addLikes")
    public R addLikes(){
        return searchhomeCourseFeign.addLikes();
    }
    @RequestMapping("/addCollects")
    public R addCollects(){
        return searchhomeCourseFeign.addCollects();
    }
    @RequestMapping("/addNewsReview")
    public R addNewsReview(@RequestBody NewsReviewAdd newsReviewAdd){
        return searchhomeCourseFeign.addNewsReview(newsReviewAdd);
    }
    @RequestMapping("/zhaosheng/selectBySchoolName/{schoolName}")
    R selectBySchoolName(@PathVariable("schoolName") String schoolName){
        return searchhomeCourseFeign.selectBySchoolName(schoolName);
    }
    @RequestMapping("/study-time/updateStudyTime/{studyTime}")
    R updateStudyTime(@PathVariable("studyTime") int studyTime){
        return searchhomeCourseFeign.updateStudyTime(studyTime);
    }
    @RequestMapping("/study-time/getStudyTime")
    public R getStudyTime(){
        return searchhomeCourseFeign.getStudyTime();
    }
    @RequestMapping("/yearquestions")
    public R getYearquestions(){
        return searchhomeCourseFeign.getYearquestions();
    }
    @RequestMapping("/searchYearQuestion/{yearId}")
    public R searchYearquestions(@PathVariable("yearId")int yearId){
        return searchhomeCourseFeign.searchYearquestions(yearId);
    }
    @RequestMapping("/exam/searchExam")
    public R getQuestion(){
        return searchhomeCourseFeign.getQuestion();
    }
    @RequestMapping("/exam/searchYearQuestion")
    public R searchYearQuestion(@RequestBody QuestionAdd questionAdd){
        return searchhomeCourseFeign.searchYearQuestion(questionAdd);
    }
    @RequestMapping("/examLog/todayQuestions")
    public R todayQuestions(){
        return searchhomeCourseFeign.todayQuestions();
    }
    @RequestMapping("/examLog/questions")
    public R questions(){
        return searchhomeCourseFeign.questions();
    }
    @RequestMapping("/question/addCollectsQuestion")
    public R addCollectsQuestion(@RequestBody QuestionAdd questionAdd){
        return searchhomeCourseFeign.addCollectsQuestion(questionAdd);
    }
    @RequestMapping("/getCollectQuestions")
    public R getCollectQuestions(){
        return searchhomeCourseFeign.getCollectQuestions();
    }
    @RequestMapping("/getErrorQuestions")
    public R getErrorQuestions(){
        return searchhomeCourseFeign.getErrorQuestions();
    }
}
